
10 DIM LL10
20 FOR I=0 TO 10
30 LLI=-1
40 NEXT
50 C=16000000
60 B=115200
70 D=C/B/4
80 P.$21
90 FOR I=0 TO 1
100 P=#2800
110[
120:LL0
130 LDA @D%256
140 STA #B502
150 LDA @D/256
160 STA #B503
170 LDA #80
180 STA #82
190 LDA #81
200 STA #83
210 LDY @#00
220:LL1
230 LDA #B501
240 AND @#02
250 BEQ LL1
260 BNE LL4
270:LL2
280 LDX @#00	\ 2 
290:LL3
300 LDA #B501	\ 4
310 AND @#02	\ 2
320 BNE LL4	\ 3
330 DEX		\ 2
340 BNE LL3	\ 3
350 DEY		\ 2
360 BNE LL3	\ 3
370 BEQ LL5
380:LL4
390 LDA #B002	\ 4
400 EOR @#04	\ 2
410 STA #B002	\ 4
420 LDA #B500	\ 4
430 LDY @#00	\ 2
440 STA (#82),Y	\ 6
450 INC #82	\ 5	
460 BNE LL2	\ 3
470 INC #83	\ 5
480 BNE LL2	\ 3 == 56
490:LL5
500 JSR LL10
510 RTS
520:LL10
530 LDA #80
540 STA #84
550 LDA #81
560 STA #85
570 LDA @#00
580 STA #86
590 STA #87
600:LL11
610 LDY @#00
620 LDA (#84),Y
630 STA #88
640 LDX @#08
650:LL12
660 LSR #88
670 ROL #86
680 ROL #87
690 BCC LL13
700 LDA #86
710 EOR @#2D
720 STA #86
730:LL13
740 DEX
750 BNE LL12
760 INC #84
770 BNE LL14
780 INC #85
790:LL14
800 LDA #84
810 CMP #82
820 BNE LL11
830 LDA #85
840 CMP #83
850 BNE LL11
860 RTS
870]
880 NEXT
890 P.$6
900 DO
910 P."WAITING FOR START OF DATA"'
920 !#80=#4000
930 LINK LL0
940 P." START = ",&!#80 & #FFFF'
950 P."   END = ",&!#82 & #FFFF'
960 P."LENGTH = ",&!#82 - !#80'
970 P."   CRC = ",&!#86 & #FFFF''
980 UNTIL 0
990 END
